<template>
  <view>
    <view class="search-bg" :style="{'background-color':bgColor}" @click="searchHandle">
      <view class="search-text" :style="{'border-radius':raduis}" @click="goSearch">
        <image src="../../static/search.png"></image>
        <text>搜索</text>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"mySearch",
    props:{
      // 背景颜色
      bgColor:{
        type:String,
        default:"#1677ff"
      },
      // 圆角弧度
      raduis:{
        type:String,
        default:"15px"
      }
    },
    data() {
      return {
       
      };
    },
    methods:{
      // 跳转到商品搜索页面
      searchHandle(){
        this.$emit('click')
      }
    },
    
  }
</script>

<style lang="scss">
  .search-bg{
      // background-color: #1677ff;
      height: 50px;
      padding: 0 10px;
      display: flex;
      align-items: center;
    .search-text{
       height: 36px;
        background-color: #ffffff;
        // border-radius: 15px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        image{
          width: 15px;
          height: 15px;
        }
        text{
          font-size: 15px;
          margin-left: 5px;
        }
    }
  }
</style>